<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\UserAuthGroupSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户权限组';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-auth-group-index">
    <br>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
    <p>
        <?= Html::a('创建权限组', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'id',
            'name',
            'rules:ntext',
            [
                'attribute'=>'status',
                'value'=>function($data){
                    return $data->status == 1 ? '已启用' : '已禁用';
                }
            ],
            ['class' => 'yii\grid\ActionColumn'],
        ],
        'emptyText'=>'当前没有用户',
        'emptyTextOptions'=>['style'=>'color:red;font-weight:bold'],
        'layout'=>"{items}\n{pager}",
    ]); ?>
</div>
